package com.springcloud.store.modular.product.controller;

import com.springcloud.commom.api.R;
import com.springcloud.stock.param.ProductParam;
import com.springcloud.store.modular.product.service.ProductService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("test")
public class TestController {

    @Resource
    ProductService productService;

    @GetMapping("add")
    public R<String> add(){
        ProductParam productParam = new ProductParam();

        productParam.setProductCount(100);
        productParam.setName("测试商品");

        productService.add(productParam);

        return R.success();
    }
}
